﻿using MediatR;
using RBAC.LuFang.API.Application.Command.GoodsCommand;
using RBAC.LuFang.Domin.Services.TraceabilityService;

namespace RBAC.LuFang.API.Application.CommandHandlers.GoodsHandler
{
    //商品删除
    public class GoodsDeleteCommandHandler:IRequestHandler<GoodsDeleteCommand,int>
    {
        private readonly IGoodsService _goodService;

        public GoodsDeleteCommandHandler(IGoodsService goodService)
        {
            _goodService = goodService;
        }

        public async Task<int> Handle(GoodsDeleteCommand request, CancellationToken cancellationToken)
        {
            return await _goodService.PiDelGoods(request.ids);
        }
    }
}
